lightcone-cli 0.3.3__tar.gz → 0.3.5__tar.gz
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.
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/.gitignore +9 -0
- lightcone_cli-0.3.5/PKG-INFO +71 -0
- lightcone_cli-0.3.5/README.md +50 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/claude/lightcone/agents/lc-extractor.md +1 -0
- lightcone_cli-0.3.5/claude/lightcone/hooks.json +30 -0
- lightcone_cli-0.3.5/claude/lightcone/scripts/activate-venv.sh +23 -0
- lightcone_cli-0.3.5/claude/lightcone/scripts/session-start.sh +79 -0
- lightcone_cli-0.3.5/claude/lightcone/scripts/validate-on-save.sh +44 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/README.md +43 -0
- lightcone_cli-0.3.3/claude/lightcone/guides/astra-reference.md → lightcone_cli-0.3.5/claude/lightcone/skills/astra/SKILL.md +28 -1
- lightcone_cli-0.3.5/claude/lightcone/skills/check-sentence-by-sentence/SKILL.md +369 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/figure-comparison/SKILL.md +578 -0
- lightcone_cli-0.3.3/claude/lightcone/guides/lightcone-cli-reference.md → lightcone_cli-0.3.5/claude/lightcone/skills/lc-cli/SKILL.md +31 -4
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/claude/lightcone/skills/lc-feedback/SKILL.md +1 -2
- {lightcone_cli-0.3.3/claude/lightcone/skills/lc-migrate → lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-code}/SKILL.md +25 -13
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/SKILL.md +164 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/references/architect.md +112 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/references/compare.md +118 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/references/implement.md +109 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/references/literature.md +199 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/references/orient.md +235 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/references/review.md +108 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/references/run.md +57 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/references/specify.md +198 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/templates/CLAUDE.md +36 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/lc-from-paper/templates/constitution.md +45 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/claude/lightcone/skills/lc-new/SKILL.md +6 -9
- lightcone_cli-0.3.5/claude/lightcone/skills/narrative/SKILL.md +228 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/narrative/references/co-drafting.md +79 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/narrative/references/existing-analysis.md +50 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/narrative/references/paper-reproduction.md +118 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/paper-extraction/SKILL.md +242 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/paper-extraction/examples/unions-bmodes-astra.yaml +106 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/paper-extraction/references/arxiv-source.md +47 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/paper-extraction/references/pdf-fallback.md +66 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/paper-extraction/scripts/extract-paper-substrate.py +1475 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/ralph/SKILL.md +195 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/ralph/references/constitution.md +133 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/ralph/references/crafting.md +181 -0
- lightcone_cli-0.3.5/claude/lightcone/skills/ralph/scripts/ralph +145 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/claude/lightcone/templates/CLAUDE.md +2 -5
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/pyproject.toml +16 -3
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/cli/commands.py +241 -86
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/manifest.py +4 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/snakefile.py +34 -0
- lightcone_cli-0.3.5/src/lightcone/engine/wrroc.py +885 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/eval/build.py +16 -53
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/eval/harness.py +3 -3
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/eval/sandbox.py +76 -70
- lightcone_cli-0.3.3/PKG-INFO +0 -19
- lightcone_cli-0.3.3/claude/lightcone/hooks/langfuse_git_commit_hook.py +0 -303
- lightcone_cli-0.3.3/claude/lightcone/hooks/langfuse_hook.py +0 -894
- lightcone_cli-0.3.3/claude/lightcone/hooks/langfuse_prepare_commit_msg.py +0 -142
- lightcone_cli-0.3.3/claude/lightcone/hooks/langfuse_session_init_hook.py +0 -83
- lightcone_cli-0.3.3/claude/lightcone/hooks/langfuse_utils.py +0 -457
- lightcone_cli-0.3.3/claude/lightcone/scripts/activate-venv.sh +0 -44
- lightcone_cli-0.3.3/claude/lightcone/scripts/check-lc-run.sh +0 -107
- lightcone_cli-0.3.3/claude/lightcone/scripts/session-start.sh +0 -120
- lightcone_cli-0.3.3/claude/lightcone/scripts/validate-on-save.sh +0 -77
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/LICENSE +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/cli/__init__.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/cli/plugin.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/__init__.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/container.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/dask_cluster.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/runner.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/scratch.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/site_registry.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/status.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/tree.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/validation.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/engine/verify.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/eval/__init__.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/eval/cli.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/eval/graders.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/eval/models.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/lightcone/eval/report.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/snakemake_executor_plugin_dask/__init__.py +0 -0
- {lightcone_cli-0.3.3 → lightcone_cli-0.3.5}/src/snakemake_executor_plugin_dask/executor.py +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lightcone-cli
|
|
3
|
+
Version: 0.3.5
|
|
4
|
+
Summary: Lightcone command-line toolchain
|
|
5
|
+
Author: Lightcone Research
|
|
6
|
+
License: BSD-3-Clause
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Requires-Dist: astra-tools>=0.2.5
|
|
10
|
+
Requires-Dist: click>=8.0
|
|
11
|
+
Requires-Dist: dask>=2024.1
|
|
12
|
+
Requires-Dist: distributed>=2024.1
|
|
13
|
+
Requires-Dist: jinja2>=3.0
|
|
14
|
+
Requires-Dist: pyyaml>=6.0
|
|
15
|
+
Requires-Dist: rich>=13.0
|
|
16
|
+
Requires-Dist: rocrate>=0.11
|
|
17
|
+
Requires-Dist: snakemake-interface-common>=1.14
|
|
18
|
+
Requires-Dist: snakemake-interface-executor-plugins>=9.0
|
|
19
|
+
Requires-Dist: snakemake>=9.0
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# lightcone-cli
|
|
23
|
+
|
|
24
|
+
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
25
|
+
[](https://pypi.org/project/lightcone-cli/)
|
|
26
|
+
[](https://github.com/LightconeResearch/lightcone-cli/actions/workflows/tests.yml)
|
|
27
|
+
[](https://pypi.org/project/lightcone-cli/)
|
|
28
|
+
|
|
29
|
+
<!-- [](https://github.com/astral-sh/ruff) -->
|
|
30
|
+
|
|
31
|
+
**lightcone-cli** (`lc`) is the agentic execution layer for
|
|
32
|
+
[ASTRA](https://astra-spec.org/latest/) (Agentic Schema for Transparent
|
|
33
|
+
Research Analysis). Describe your analysis to an AI agent and `lc` takes
|
|
34
|
+
care of the rest — specification, execution, and provenance.
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
uv tool install lightcone-cli
|
|
40
|
+
lc init my-analysis
|
|
41
|
+
cd my-analysis
|
|
42
|
+
claude
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then tell the agent what you have to start from — a research question
|
|
46
|
+
(`/lc-new`), existing code (`/lc-from-code`), or a paper to reproduce
|
|
47
|
+
(`/lc-from-paper`).
|
|
48
|
+
|
|
49
|
+
→ [Full getting-started guide](https://docs.lightconeresearch.org/user/getting-started/)
|
|
50
|
+
|
|
51
|
+
## Skills
|
|
52
|
+
|
|
53
|
+
| Skill | What it does |
|
|
54
|
+
|---|---|
|
|
55
|
+
| [`/lc-new`](https://docs.lightconeresearch.org/skills/lc-new/) | Scope a new analysis from a research question into a full `astra.yaml` spec |
|
|
56
|
+
| [`/lc-from-code`](https://docs.lightconeresearch.org/skills/lc-from-code/) | Bring an existing codebase into ASTRA |
|
|
57
|
+
| [`/lc-from-paper`](https://docs.lightconeresearch.org/skills/lc-from-paper/) | Reproduce a published paper end-to-end |
|
|
58
|
+
| [`/lc-feedback`](https://docs.lightconeresearch.org/skills/lc-feedback/) | File a bug report with version and error context auto-collected |
|
|
59
|
+
|
|
60
|
+
## Capabilities
|
|
61
|
+
|
|
62
|
+
- **Multiverse analysis** — define methodological decisions with multiple options; `lc` runs your analysis across all defensible paths automatically
|
|
63
|
+
- **Provenance integrity** — every output gets a content-addressed manifest; `lc verify` detects tampering or broken chains
|
|
64
|
+
- **HPC-ready execution** — Snakemake-backed DAG dispatch with SLURM and container support (Docker, Podman, Apptainer) out of the box
|
|
65
|
+
- **Reproducible publishing** — `lc export wrroc` emits a [Workflow Run RO-Crate](https://www.researchobject.org/workflow-run-crate/) bundle ready for Zenodo or WorkflowHub
|
|
66
|
+
|
|
67
|
+
→ [Full documentation](https://docs.lightconeresearch.org)
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
BSD 3-Clause — see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# lightcone-cli
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
4
|
+
[](https://pypi.org/project/lightcone-cli/)
|
|
5
|
+
[](https://github.com/LightconeResearch/lightcone-cli/actions/workflows/tests.yml)
|
|
6
|
+
[](https://pypi.org/project/lightcone-cli/)
|
|
7
|
+
|
|
8
|
+
<!-- [](https://github.com/astral-sh/ruff) -->
|
|
9
|
+
|
|
10
|
+
**lightcone-cli** (`lc`) is the agentic execution layer for
|
|
11
|
+
[ASTRA](https://astra-spec.org/latest/) (Agentic Schema for Transparent
|
|
12
|
+
Research Analysis). Describe your analysis to an AI agent and `lc` takes
|
|
13
|
+
care of the rest — specification, execution, and provenance.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uv tool install lightcone-cli
|
|
19
|
+
lc init my-analysis
|
|
20
|
+
cd my-analysis
|
|
21
|
+
claude
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then tell the agent what you have to start from — a research question
|
|
25
|
+
(`/lc-new`), existing code (`/lc-from-code`), or a paper to reproduce
|
|
26
|
+
(`/lc-from-paper`).
|
|
27
|
+
|
|
28
|
+
→ [Full getting-started guide](https://docs.lightconeresearch.org/user/getting-started/)
|
|
29
|
+
|
|
30
|
+
## Skills
|
|
31
|
+
|
|
32
|
+
| Skill | What it does |
|
|
33
|
+
|---|---|
|
|
34
|
+
| [`/lc-new`](https://docs.lightconeresearch.org/skills/lc-new/) | Scope a new analysis from a research question into a full `astra.yaml` spec |
|
|
35
|
+
| [`/lc-from-code`](https://docs.lightconeresearch.org/skills/lc-from-code/) | Bring an existing codebase into ASTRA |
|
|
36
|
+
| [`/lc-from-paper`](https://docs.lightconeresearch.org/skills/lc-from-paper/) | Reproduce a published paper end-to-end |
|
|
37
|
+
| [`/lc-feedback`](https://docs.lightconeresearch.org/skills/lc-feedback/) | File a bug report with version and error context auto-collected |
|
|
38
|
+
|
|
39
|
+
## Capabilities
|
|
40
|
+
|
|
41
|
+
- **Multiverse analysis** — define methodological decisions with multiple options; `lc` runs your analysis across all defensible paths automatically
|
|
42
|
+
- **Provenance integrity** — every output gets a content-addressed manifest; `lc verify` detects tampering or broken chains
|
|
43
|
+
- **HPC-ready execution** — Snakemake-backed DAG dispatch with SLURM and container support (Docker, Podman, Apptainer) out of the box
|
|
44
|
+
- **Reproducible publishing** — `lc export wrroc` emits a [Workflow Run RO-Crate](https://www.researchobject.org/workflow-run-crate/) bundle ready for Zenodo or WorkflowHub
|
|
45
|
+
|
|
46
|
+
→ [Full documentation](https://docs.lightconeresearch.org)
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
BSD 3-Clause — see [LICENSE](LICENSE) for details.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
name: lc-extractor
|
|
3
3
|
description: Extract prior insights from scientific papers for ASTRA analyses. Reads PDFs, identifies claims relevant to target decisions, extracts verbatim quotes, and verifies them. Use for literature extraction during /lc-new.
|
|
4
4
|
tools: Read, Bash
|
|
5
|
+
model: sonnet
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
You are an ASTRA prior insight extraction agent with self-validation capability. Your task is to extract prior insights from a single paper and format them for an ASTRA analysis. Prior insights are knowledge from literature that informs analysis decisions — they go in the `prior_insights:` section of astra.yaml.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"SessionStart": [
|
|
3
|
+
{
|
|
4
|
+
"hooks": [
|
|
5
|
+
{
|
|
6
|
+
"type": "command",
|
|
7
|
+
"command": "bash ${CLAUDE_PROJECT_DIR}/.claude/scripts/activate-venv.sh",
|
|
8
|
+
"timeout": 5
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "command",
|
|
12
|
+
"command": "bash ${CLAUDE_PROJECT_DIR}/.claude/scripts/session-start.sh",
|
|
13
|
+
"timeout": 15
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"PostToolUse": [
|
|
19
|
+
{
|
|
20
|
+
"matcher": "Write|Edit",
|
|
21
|
+
"hooks": [
|
|
22
|
+
{
|
|
23
|
+
"type": "command",
|
|
24
|
+
"command": "bash ${CLAUDE_PROJECT_DIR}/.claude/scripts/validate-on-save.sh",
|
|
25
|
+
"timeout": 15
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# SessionStart hook: prepend the project venv to PATH for every Bash command
|
|
3
|
+
# Claude Code spawns this session.
|
|
4
|
+
#
|
|
5
|
+
# We don't `source` activate -- we only need PATH and VIRTUAL_ENV. Sourcing
|
|
6
|
+
# activate also runs prompt mutations and defines a deactivate function we
|
|
7
|
+
# don't want, and any non-zero status under `set -e` would silently skip
|
|
8
|
+
# the writeback (the failure mode behind issue #103). Writing the two
|
|
9
|
+
# exports directly to CLAUDE_ENV_FILE is the documented mechanism and is
|
|
10
|
+
# what every downstream hook implicitly relies on for `astra` / `lc` to
|
|
11
|
+
# resolve to the project venv rather than whatever system install happens
|
|
12
|
+
# to be on PATH.
|
|
13
|
+
|
|
14
|
+
VENV="$CLAUDE_PROJECT_DIR/.venv"
|
|
15
|
+
[ -d "$VENV/bin" ] || exit 0
|
|
16
|
+
[ -n "$CLAUDE_ENV_FILE" ] || exit 0
|
|
17
|
+
|
|
18
|
+
{
|
|
19
|
+
echo "export VIRTUAL_ENV=$VENV"
|
|
20
|
+
echo "export PATH=$VENV/bin:\$PATH"
|
|
21
|
+
} >> "$CLAUDE_ENV_FILE"
|
|
22
|
+
|
|
23
|
+
exit 0
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# SessionStart hook: surface a terse project status to the agent.
|
|
3
|
+
#
|
|
4
|
+
# Reports validation status, materialization counts, and a tight CLI
|
|
5
|
+
# primer so the agent knows what substrate commands exist and which
|
|
6
|
+
# reference skills carry the depth. Project name / decision count /
|
|
7
|
+
# universe count are intentionally omitted -- they are trivia the agent
|
|
8
|
+
# reads from astra.yaml and CLAUDE.md when needed, and they cost against
|
|
9
|
+
# the 10k additionalContext budget.
|
|
10
|
+
|
|
11
|
+
input=$(cat)
|
|
12
|
+
cwd=$(echo "$input" | jq -r '.cwd // empty')
|
|
13
|
+
|
|
14
|
+
[ -z "$cwd" ] && exit 0
|
|
15
|
+
cd "$cwd" 2>/dev/null || exit 0
|
|
16
|
+
[ -f "astra.yaml" ] || exit 0
|
|
17
|
+
|
|
18
|
+
# astra and lc both come from the project venv (prepended to PATH by
|
|
19
|
+
# activate-venv.sh). If neither resolved, the venv setup is broken and
|
|
20
|
+
# there is nothing useful we can report.
|
|
21
|
+
command -v astra &>/dev/null || exit 0
|
|
22
|
+
command -v lc &>/dev/null || exit 0
|
|
23
|
+
|
|
24
|
+
validation_output=$(astra validate astra.yaml 2>&1)
|
|
25
|
+
validation_ok=$?
|
|
26
|
+
|
|
27
|
+
status_json=$(lc status --json 2>/dev/null)
|
|
28
|
+
counts=$(echo "$status_json" | jq -r '
|
|
29
|
+
[.universes[].outputs[].status] as $s |
|
|
30
|
+
{
|
|
31
|
+
ok: ($s | map(select(. == "ok")) | length),
|
|
32
|
+
stale: ($s | map(select(. == "stale")) | length),
|
|
33
|
+
missing: ($s | map(select(. == "missing")) | length),
|
|
34
|
+
alias: ($s | map(select(. == "alias")) | length)
|
|
35
|
+
} | "\(.ok) \(.stale) \(.missing) \(.alias)"
|
|
36
|
+
' 2>/dev/null)
|
|
37
|
+
read -r ok_count stale_count missing_count alias_count <<<"$counts"
|
|
38
|
+
ok_count=${ok_count:-0}
|
|
39
|
+
stale_count=${stale_count:-0}
|
|
40
|
+
missing_count=${missing_count:-0}
|
|
41
|
+
alias_count=${alias_count:-0}
|
|
42
|
+
|
|
43
|
+
if [ "$validation_ok" -eq 0 ]; then
|
|
44
|
+
summary="ASTRA project — validation: valid"
|
|
45
|
+
else
|
|
46
|
+
summary="ASTRA project — validation: has errors"
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
summary="$summary
|
|
50
|
+
Materialization: ok=$ok_count stale=$stale_count missing=$missing_count alias=$alias_count
|
|
51
|
+
|
|
52
|
+
Substrate CLIs (use --help on any):
|
|
53
|
+
lc init / lc run / lc status / lc verify / lc build / lc export wrroc
|
|
54
|
+
astra validate / astra paper add / astra universe generate
|
|
55
|
+
|
|
56
|
+
Reference skills (invoke when the surface above isn't enough):
|
|
57
|
+
/astra — astra.yaml spec: decisions, prior_insights, findings, evidence, sub-analyses, narrative anchors
|
|
58
|
+
/lc-cli — lc workflow: spec-code invariant, status interpretation, failure diagnosis"
|
|
59
|
+
|
|
60
|
+
if [ "$validation_ok" -ne 0 ]; then
|
|
61
|
+
# tail rather than head -- the leading lines are success markers
|
|
62
|
+
# ("✓ Schema validation passed" etc.) and the actual error block is
|
|
63
|
+
# at the bottom.
|
|
64
|
+
error_preview=$(echo "$validation_output" | tail -20)
|
|
65
|
+
summary="$summary
|
|
66
|
+
|
|
67
|
+
Validation errors (run 'astra validate astra.yaml' for full output):
|
|
68
|
+
$error_preview"
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
needs_run=$((missing_count + stale_count))
|
|
72
|
+
if [ "$needs_run" -gt 0 ]; then
|
|
73
|
+
summary="$summary
|
|
74
|
+
|
|
75
|
+
ACTION REQUIRED: $needs_run output(s) need \`lc run\` ($missing_count missing, $stale_count stale)."
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
jq -n --arg ctx "$summary" '{hookSpecificOutput: {hookEventName: "SessionStart", additionalContext: $ctx}}'
|
|
79
|
+
exit 0
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# PostToolUse(Write|Edit) hook: re-validate after writes to astra.yaml or a
|
|
3
|
+
# universe file, push errors back to the agent as additionalContext.
|
|
4
|
+
#
|
|
5
|
+
# astra is resolved from the project venv via PATH (prepended at
|
|
6
|
+
# SessionStart by activate-venv.sh). Issue #103 traced back to this hook
|
|
7
|
+
# running an older, globally-installed astra when activate-venv failed
|
|
8
|
+
# silently -- with the venv reliably on PATH that whole code path is
|
|
9
|
+
# unnecessary.
|
|
10
|
+
|
|
11
|
+
input=$(cat)
|
|
12
|
+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // .tool_response.filePath // empty')
|
|
13
|
+
[ -z "$file_path" ] && exit 0
|
|
14
|
+
|
|
15
|
+
filename=$(basename "$file_path")
|
|
16
|
+
parent=$(basename "$(dirname "$file_path")")
|
|
17
|
+
|
|
18
|
+
# Filter to astra.yaml at any depth and universe files (universes/*.yaml)
|
|
19
|
+
if [ "$filename" = "astra.yaml" ]; then
|
|
20
|
+
project_root=$(dirname "$file_path")
|
|
21
|
+
elif [ "$parent" = "universes" ] && [[ "$filename" == *.yaml ]]; then
|
|
22
|
+
project_root=$(dirname "$(dirname "$file_path")")
|
|
23
|
+
else
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
command -v astra &>/dev/null || exit 0
|
|
28
|
+
cd "$project_root" 2>/dev/null || exit 0
|
|
29
|
+
|
|
30
|
+
if [ "$filename" = "astra.yaml" ]; then
|
|
31
|
+
result=$(astra validate astra.yaml 2>&1)
|
|
32
|
+
else
|
|
33
|
+
result=$(astra validate "$file_path" 2>&1)
|
|
34
|
+
fi
|
|
35
|
+
exit_code=$?
|
|
36
|
+
|
|
37
|
+
if [ $exit_code -eq 0 ]; then
|
|
38
|
+
msg="ASTRA validation passed for $filename"
|
|
39
|
+
else
|
|
40
|
+
msg=$(printf 'ASTRA validation FAILED for %s:\n%s' "$filename" "$result")
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
jq -n --arg ctx "$msg" '{hookSpecificOutput: {hookEventName: "PostToolUse", additionalContext: $ctx}}'
|
|
44
|
+
exit 0
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# lightcone-cli skills
|
|
2
|
+
|
|
3
|
+
Each subdirectory is one Claude Code skill: `SKILL.md` plus optional `references/`, `assets/`, and `scripts/`. `lc init` copies these into a project's `.claude/skills/` so they are discoverable to Claude Code sessions.
|
|
4
|
+
|
|
5
|
+
## Project lifecycle skills
|
|
6
|
+
|
|
7
|
+
| Skill | Role |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `lc-new` | Scaffold a new ASTRA-shaped project from a research question. |
|
|
10
|
+
| `lc-from-code` | Bring an existing codebase into ASTRA — scan, spec, parameterize. |
|
|
11
|
+
| `lc-from-paper` | Reproduce a published paper in ASTRA (paper-reproduction bundle entry point — see below). |
|
|
12
|
+
| `lc-feedback` | Report bugs and feature requests upstream. |
|
|
13
|
+
| `ralph` | Author a constitution and run a ralph loop against it (authoring + launching + iterating in one skill). `lc-from-paper` uses this for the long middle of a reproduction; standalone for any other long-running work. |
|
|
14
|
+
|
|
15
|
+
## Reference skills
|
|
16
|
+
|
|
17
|
+
Not direct entry points — Claude invokes these (or other skills invoke them) to load reference content into the session. The session-start hook primes their names so they're discoverable from turn one.
|
|
18
|
+
|
|
19
|
+
| Skill | Role |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `astra` | Reference for the `astra.yaml` spec: structure, decisions, options, prior insights, findings, evidence, sub-analyses, narrative anchors, composition mechanics. |
|
|
22
|
+
| `lc-cli` | Reference for `lc` workflow: commands, the Spec-Code Invariant, status interpretation, failure diagnosis, multiverse runs, WRROC export. |
|
|
23
|
+
|
|
24
|
+
## Paper-reproduction bundle
|
|
25
|
+
|
|
26
|
+
A self-contained toolkit for reproducing published papers in ASTRA. The bundle is co-located so a single `lc init` brings the full toolkit into a project — no plugin marketplace, no separate installs.
|
|
27
|
+
|
|
28
|
+
| Skill | Role |
|
|
29
|
+
|---|---|
|
|
30
|
+
| [`lc-from-paper`](lc-from-paper/SKILL.md) | **Reproduction driver.** ORIENT-first; one pre-loop phase in the user's main session that asks for the paper, runs `/paper-extraction` inline, interviews the user (grounded in the paper), clones the reference code and runs `/lc-from-code` scan-only (when a repo exists), and drafts the per-paper `constitution.md` + `CLAUDE.md`. Then hands off to a ralph loop whose iterations carry the long middle: ARCHITECT → SPECIFY → LITERATURE → IMPLEMENT → RUN → COMPARE. When the loop closes (constitution `status: closed` after COMPARE returns `pass`), REVIEW runs back in the user's main session. Fidelity intent — captured as prose at ORIENT — is what every iteration reads when sizing its next move, and what COMPARE grades opportunities against. |
|
|
31
|
+
| [`ralph`](ralph/SKILL.md) | The loop substrate. `lc-from-paper`'s ORIENT invokes `/ralph`'s Authoring mode to draft the per-paper constitution; the loop launcher hands off after ORIENT lands. Each iteration runs `/ralph`'s Loop protocol against the constitution. |
|
|
32
|
+
| [`narrative`](narrative/SKILL.md) | Author the `narrative:` prose and decision `rationale:` in `astra.yaml`. Invoked by `lc-from-paper`'s ARCHITECT (for the structural narrative) and SPECIFY (for anchored content narrative). |
|
|
33
|
+
| [`paper-extraction`](paper-extraction/SKILL.md) | Turn an arXiv ID or DOI into a standardized `work/reference/` directory: structural index (figures, tables, outline, citations with resolved DOIs) plus a stub `astra.yaml` for the paper. Primary acquisition path for `lc-from-paper`'s ORIENT (Stage 2); also invoked per cited paper by LITERATURE. |
|
|
34
|
+
| [`check-sentence-by-sentence`](check-sentence-by-sentence/SKILL.md) | Audit paper claims against code locations (`file:line` or `NOT FOUND`). Invoked from `lc-from-paper`'s REVIEW close-out (opt-in); also user-invokable directly. |
|
|
35
|
+
| [`figure-comparison`](figure-comparison/SKILL.md) | Build a self-contained HTML side-by-side: original figures/tables/numerics vs replicated. Invoked from `lc-from-paper`'s REVIEW close-out (mandatory); also user-invokable directly. |
|
|
36
|
+
|
|
37
|
+
The full reproduction story spans these skills. `lc-from-paper`'s `SKILL.md` names each by role and tells the agent when to invoke them; the siblings stand alone and don't know about `lc-from-paper`.
|
|
38
|
+
|
|
39
|
+
### Why bundle (not depend on plugin install)
|
|
40
|
+
|
|
41
|
+
- **Testability.** We want to verify `lc-from-paper` invokes its sibling skills correctly. That only works when all are in the same checkout.
|
|
42
|
+
- **Single install path.** `lc init` brings the full toolkit. Adding a separate plugin-marketplace step is friction we don't need.
|
|
43
|
+
- **Future consolidation is open.** The long-run shape may be `astra` ships skills in `astra`, `lc` ships skills in `lightcone-cli`, plus a centralized external-skills list. Today: bundle it all. See [[lightcone/skills-location-policy]].
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: astra
|
|
3
|
+
description: >
|
|
4
|
+
Comprehensive reference for the `astra.yaml` specification — top-level
|
|
5
|
+
structure, sub-analyses, inputs/outputs, decisions and options, prior
|
|
6
|
+
insights and findings, evidence and quote verification, narrative
|
|
7
|
+
anchors, and composition mechanics. Invoke whenever reading, writing,
|
|
8
|
+
validating, or debugging an `astra.yaml` spec; whenever working with
|
|
9
|
+
decisions, options, prior_insights, findings, or evidence; or whenever
|
|
10
|
+
the user asks about ASTRA schema, spec syntax, or sub-analysis
|
|
11
|
+
composition.
|
|
12
|
+
allowed-tools: Read, Glob, Grep, Bash(astra:*)
|
|
13
|
+
---
|
|
14
|
+
|
|
1
15
|
# ASTRA Reference
|
|
2
16
|
|
|
3
17
|
## What an ASTRA Analysis Is
|
|
@@ -100,6 +114,17 @@ A decision is a methodological choice where a different defensible option could
|
|
|
100
114
|
|
|
101
115
|
Decisions may carry an optional `tags:` list for grouping (e.g. `[preprocessing]`, `[physics]`, `[stats]`). Keep the tag vocabulary **small and consolidated** -- reuse existing tags rather than minting new ones, since tags are mostly useful for cross-cutting views over a shared decision space, and that view fragments quickly when every decision invents its own label.
|
|
102
116
|
|
|
117
|
+
### Options
|
|
118
|
+
|
|
119
|
+
Each decision must have at least one option. Options are `key: { ... }` entries:
|
|
120
|
+
|
|
121
|
+
- `label:` (required) -- short human-readable name for compact rendering.
|
|
122
|
+
- `description:` (optional) -- longer prose explaining what the option means.
|
|
123
|
+
- `insights:` (optional) -- list of `prior_insights:` IDs that justify this option; back-references the supporting evidence (see [Prior Insights and Findings](#prior-insights-and-findings)).
|
|
124
|
+
- `excluded:` + `excluded_reason:` -- option considered but rejected. See [Constraints](#constraints).
|
|
125
|
+
|
|
126
|
+
`label:` and `options:` are required on the decision itself. An aliased decision (one that points at another via `from: ../decisions.foo` -- see [Composition Mechanics](#composition-mechanics)) inherits both from its source and doesn't redeclare them.
|
|
127
|
+
|
|
103
128
|
### Parameterization
|
|
104
129
|
|
|
105
130
|
**Every decision must be parameterized in code** -- never hardcode a decision value. The recipe's `command:` template references it via `{decisions.<id>}` (see [Command Template Substitution](#command-template-substitution)).
|
|
@@ -137,6 +162,8 @@ Set `container:` at analysis level (all recipes inherit); per-recipe `container:
|
|
|
137
162
|
|
|
138
163
|
Runners expand `{...}` placeholders in `command:` before invoking it: `{inputs.<id>}` (input path), `{inputs}` (all input paths, declared order), `{decisions.<id>}` (active option ID), `{output}` (artifact path), `{{`/`}}` (literal braces). Every `{inputs.<id>}` and `{decisions.<id>}` must name something declared in the parent Output's `inputs:`/`decisions:` lists -- always **local IDs** (no `../`; bridging is declared once at the Input/Decision via `from:`).
|
|
139
164
|
|
|
165
|
+
Text outside `{...}` is literal command text and isn't validated. Static constants (`--max-iter 1000`), per-output specialisations when fan-out is unrolled into one Output per value (`--tracer lrg1`), and shell features (`${VAR}`, pipes, redirects) all live as plain text. Only values that vary across the multiverse need to be `{decisions.<id>}` placeholders -- there is no separate `params` channel, and Snakemake-style wildcards (`{chunk_id}`, `{block_i}`) have no spec-level analogue: either inline the value, unroll the fan-out into one Output per value, or describe only the aggregated artifact.
|
|
166
|
+
|
|
140
167
|
### Conditional Outputs
|
|
141
168
|
|
|
142
169
|
Outputs can have `when` conditions -- the output only exists when the condition is met for a given universe. Uses the same syntax as decision `when` (negation with `~`, lists AND'd).
|
|
@@ -171,7 +198,7 @@ Two kinds of insight, distinguished by direction:
|
|
|
171
198
|
- **Prior insights** (`prior_insights:`) — knowledge from outside the analysis that informs decisions. From literature (by DOI) or artifacts from a prior/parent analysis.
|
|
172
199
|
- **Findings** (`findings:`) — conclusions from the analysis itself, backed by its own output artifacts.
|
|
173
200
|
|
|
174
|
-
Both use the same Insight model: `id`, `
|
|
201
|
+
Both use the same Insight model. Required: `id`, `claim`, `created_at` (ISO 8601 datetime — e.g. `"2025-02-01T14:00:00"`), `evidence`. Optional: `label`, `derived` (true if synthesized/inferred from multiple sources), `scope` (applicability conditions), `tags`, `notes`. Placement determines direction.
|
|
175
202
|
|
|
176
203
|
Each evidence item has its own fields: `id`, exactly one of `doi` (literature) or `artifact` (output ID), and either a `quote` (TextQuoteSelector with required `exact`, optional `prefix`/`suffix`) or `location` (FragmentSelector with `value` like `"page=6"` and/or 1-indexed `page`). DOI evidence may add `version` (arXiv version). Artifact evidence may add `snapshot` (path to an immutable artifact copy) and `source_commit` (git commit that produced it).
|
|
177
204
|
|