rootcastleco/rei-skills / registry/external-reviewed/directory-build-organization
directory-build-organization
VerifiedUSE ONLY for (1) two or more projects with repeated MSBuild policy, targets, or package versions, or (2) an existing Directory.Build.props/targets/rsp hierarchy with an import, placement, or layering defect. A one-project repo without an existing Directory.Build file is outside scope; do not load this skill. Covers centralizing shared policy and targets, Directory.Packages.props across projects, parent hierarchy/import structure, props-versus-targets placement, and folder/project exceptions. An existing hierarchy defect remains in scope when only one project is affected. For property value or condition semantics use property-patterns. Exclude legacy-to-SDK migration and non-MSBuild systems.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 1.1 KB |
| SKILL.md | skill md | 10.8 KB |
| references/common-patterns.md | markdown | 1.4 KB |
| references/multi-level-examples.md | markdown | 3.9 KB |
| references/targetframework-props-pitfall.md | markdown | 3.3 KB |
references/common-patterns.md
View on GitHub# Common Directory.Build Patterns
## Conditional Settings by Project Type
Detect test projects by naming convention in `Directory.Build.props`:
```xml
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Tests')) OR $(MSBuildProjectName.EndsWith('.UnitTests'))">
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
```
Use `Directory.Build.targets` for conditions on SDK-defined properties like `OutputType`:
```xml
<PropertyGroup Condition="'$(OutputType)' == 'Exe'">
<SelfContained>false</SelfContained>
</PropertyGroup>
<PropertyGroup Condition="'$(OutputType)' == 'Library' AND '$(IsTestProject)' != 'true'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
```
## Post-Build Validation
Validate that `Pack` produced the expected output:
```xml
<Target Name="ValidatePackageOutput" AfterTargets="Pack"
Condition="'$(IsPackable)' == 'true'">
<Error Text="Package was not created at $(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg"
Condition="!Exists('$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg')" />
</Target>
```
## Artifact Output Layout (.NET 8+)
Setting `ArtifactsPath` in `Directory.Build.props` produces this structure:
```
artifacts/
bin/
MyLib/
debug/
release/
MyApp/
debug/
release/
obj/
MyLib/
MyApp/
publish/
MyApp/
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |