Skip to content
Back to skills

Docs

ASecurity

> **Stage ID**: s1_project_setup > **Pipeline order**: 1 of 10 > **Depends on**: none

  • 200 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
testingpythonbashgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 18 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add lzwei196/KISS---Knowledge-Infrastructure-for-Scientific-Simulation --skill docs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lzwei196-docs-657d9ed9/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-657d9ed9)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Project Structure Setup — Skill Document

> **Stage ID**: s1_project_setup
> **Pipeline order**: 1 of 10
> **Depends on**: none

## Purpose

Create the LDNDC project directory structure and generate the master `project.xml` configuration file that defines simulation schedule, geographic coordinates, input file sources, and output destinations. All subsequent stages depend on this structure existing.

## Prerequisites

Before starting this stage, verify:

- [ ] LDNDC binary is installed and accessible at the expected path
- [ ] Target output directory parent exists and is writable
- [ ] Basin coordinates (lat/lon) and simulation period (start/end dates) are known
- [ ] Python environment activated: `source KISSPATH_PYTHON_ENV/bin/activate`

## Inputs

| Input | Type | Source | Description |
|-------|------|--------|-------------|
| project_dir | directory | User-specified | Root directory for this LDNDC simulation |
| basin_name | string | User-specified | Identifier used for file naming |
| lat | number | Basin delineation or user | Latitude in decimal degrees |
| lon | number | Basin delineation or user | Longitude in decimal degrees |
| start_date | string | User-specified | Simulation start (YYYY-MM-DD) |
| end_date | string | User-specified | Simulation end (YYYY-MM-DD) |

## Procedure

### Step 1: Create project directory structure

```bash
python tools/s1_project_setup/create_project_structure.py
```

Set `project_dir` and `basin_name` before running. This creates:
```
{project_dir}/
  input/
  output/
```

**Expected result**: Directory exists with `input/` and `output/` subdirectories.

**If this fails**: Check parent directory exists and is writable.

### Step 2: Generate project.xml

```bash
python tools/s1_project_setup/generate_project_xml.py
```

Set `project_dir`, `lat`, `lon`, `start_date`, `end_date` before running.

**Expected result**: `project.xml` exists at `{project_dir}/project.xml` with content like:

```xml
<ldndcproject id="0" lat="33.5" lon="117.2">
  <schedule time="2000-01-01/24 -> 2010-12-31"/>
  <input>
    <sources sourceprefix="input/">
      <site source="site.xml"/>
      <event source="mana.xml"/>
      <setup source="setup.xml"/>
      <climate source="climate.txt"/>
      <airchemistry source="airchem.txt"/>
      <speciesparameters source="parameters_species.xml"/>
      <siteparameters source="parameters_site.xml"/>
    </sources>
    <attributes use="0">
      <airchemistry endless="yes"/>
    </attributes>
  </input>
  <output>
    <sinks sinkprefix="output/"/>
  </output>
</ldndcproject>
```

**If this fails**: See diagnostic triplet dt_001.

## Expected Outputs

| Output | Path | Verification |
|--------|------|--------------|
| Project directory | `{project_dir}/` | Directory exists with input/ and output/ subdirs |
| project.xml | `{project_dir}/project.xml` | Well-formed XML; `xmllint --noout project.xml` returns 0 |

## Validation Checks

1. **Directory structure**: Verify `input/` and `output/` exist inside project_dir
2. **XML validity**: Parse project.xml; check it has `ldndcproject`, `schedule`, `input`, `output` elements
3. **Schedule dates**: Verify start_date < end_date and both are valid ISO 8601 dates
4. **Source prefix**: Verify `sourceprefix` ends with `/`

## Common Pitfalls

> **PITFALL**: sourceprefix missing trailing slash
> The `sourceprefix` attribute in project.xml must end with `/`. Without it, LDNDC concatenates prefix+filename without a separator (e.g., `inputsite.xml` instead of `input/site.xml`).
> **Do this instead**: Always ensure sourceprefix = "input/"
> See diagnostic triplet dt_001 for full details.

> **PITFALL**: Using absolute paths in project.xml
> If project.xml uses absolute paths and the project is moved to a different location, all paths break. Use relative paths from the project.xml directory.
> **Do this instead**: Use relative sourceprefix (e.g., "input/") and run LDNDC from the project directory.

---

*This skill document is part of the ldndc-knowledge-infrastructure package.*
*Stage 1 of 10 | Tools used: create_project_structure, generate_project_xml | Related triplets: dt_001*

Files in this skill

  • REFERENCES.md1.3 KB
  • format_spec.yaml34.9 KB
  • model_couplings.yaml9.6 KB
  • papers.json6.7 KB
  • s10_vic_coupling_skill.md5.2 KB
  • s1_installation_skill.md4.9 KB
  • s1_project_setup_skill.md4 KB
  • s2_site_config_skill.md4.7 KB
  • s3_setup_modules_skill.md4.3 KB
  • s4_climate_prep_skill.md4 KB
  • s5_airchemistry_prep_skill.md2.7 KB
  • s6_management_config_skill.md4.2 KB
  • s7_species_params_skill.md3.4 KB
  • s8_execution_skill.md4 KB
  • s9_coupling_skill.md7.3 KB
  • s9_output_parsing_skill.md4.5 KB
  • validation_convention.yaml18.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…